/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package pt.iasd.youthshelter.honor.nodes;

import java.util.List;
import org.openide.nodes.Children;
import org.openide.nodes.Node;
import pt.iasd.youthshelter.datamodel.Honor;

/**
 *
 * @author Rui
 */
public class HonorChildren extends Children.Keys<Honor> {
    private List<Honor> honors;

    public HonorChildren(List<Honor> honors) {
        this.honors = honors;
    }
    
    @Override
    protected Node[] createNodes(Honor key) {
        return new Node[] {new HonorNode(key)};
    }

    @Override
    protected void addNotify() {
        if(honors != null) {
            setKeys(honors);
        }
    }
}
